# Contributor: Scott Robinson <ssr@squareup.com>
# Maintainer: Scott Robinson <ssr@squareup.com>
pkgname=fulcrum
_pkgname=Fulcrum
pkgver=1.6.0
pkgrel=1
pkgdesc="Fast & nimble SPV Server for BCH and BTC"
url="https://github.com/cculianu/Fulcrum"
arch="all !riscv64" # limited by rocksdb
license="GPL-3.0-or-later"
makedepends="rocksdb-dev zlib-dev bzip2-dev zeromq-dev qt5-qtbase-dev"
subpackages="$pkgname-admin:admin:noarch $pkgname-doc"
source="$pkgname-$pkgver.tar.gz::https://github.com/cculianu/$_pkgname/archive/v$pkgver.tar.gz
	signet.patch
	"
builddir="$srcdir/$_pkgname-$pkgver"
options="!check"

build() {
	qmake-qt5 PREFIX=/usr $_pkgname.pro
	make
}

package() {
	make install INSTALL_ROOT="$pkgdir"
	mv "$pkgdir"/usr/bin/$_pkgname "$pkgdir"/usr/bin/$pkgname
}

admin() {
	pkgdesc="Fulcrum Admin CLI"
	depends="python3"
	mkdir -p "$subpkgdir"/usr/bin
	mv "$pkgdir"/usr/bin/${_pkgname}Admin "$subpkgdir"/usr/bin/$pkgname-admin
}

sha512sums="
a292dda19aa510652a6f9fd2ac9b50add85054188ef6087bcae01143d8ee5b26af9203745b76736a2f5f489d4e539fe5917bc64243e7410f9ea07e1420fa7c27  fulcrum-1.6.0.tar.gz
455b152c98c3850d8e4cc87c2881ca5e7d1ff922c8f5cc73b5fdf84bba3a5bee30a47afe48f950adb7f01ce3beb1743101ccd025cb4a87e010d3f6bcbc3b7291  signet.patch
"
